﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DBLClient.DBLForm
{
    class Tools
    {
        /// <summary>
        /// 根据地区码 检查adminlevel的值，是否有资格修改dblno
        /// </summary>
        /// <param name="dblno"></param>
        /// <param name="adminlevel"></param>
        /// <returns></returns>
        public static bool IsMatchAdminLevel(string dblno, string adminlevel)
        {
            if (adminlevel.Equals("ADMIN"))
            {
                return true;
            }
            if (adminlevel.Equals("ALL"))
            {
                return true;
            }
            string[] adminlevelArray = adminlevel.Split(',');
            foreach (string s in adminlevelArray)
            {
                if (dblno.StartsWith(s))
                {
                    return true;
                    
                }
            }
            return false;
        }
    }
}
